<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商品')" />
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-commodity-edit" th:object="${commodity}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商品名称：</label>
                <div class="col-sm-8">
                    <input name="commodityName" th:field="*{commodityName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品款式：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" th:field="*{commodityStyle}" id="commodityStyle" name="commodityStyle">
                        <option value="男款">男款</option>
                        <option value="女款">女款</option>
                    </select>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品类型：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" th:field="*{commodityType}" id="commodityType" name="commodityType">
                        <option value="鞋类">鞋类</option>
                        <option value="服装">服装</option>
                        <option value="配饰">配饰</option>
                    </select>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品品牌：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b"  th:field="*{brandId}" id="brandId" name="brandId">
                        <option value="">--商品品牌--</option>
                        <option th:each="brand : ${brandList}"
                                th:text="${brand.brandName}"
                                th:value="${brand.id}">

                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商品价格：</label>
                <div class="col-sm-8">
                    <input name="commodityPrice" th:field="*{commodityPrice}" class="form-control" type="text" required>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "system/commodity";
        $("#form-commodity-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-commodity-edit').serialize());
            }
        }
    </script>
</body>
</html>
